package com.swak.boot.config.job.queue;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.swak.job.queue.QueueService;
import com.swak.job.queue.rabbitmq.RabbitmqQueueService;
import com.swak.rabbit.RabbitMQTemplate;

/**
 * 基于消息队列
 * 
 * @author DELL
 */
@Configuration
@ConditionalOnClass({ RabbitMQTemplate.class })
@ConditionalOnMissingBean(QueueService.class)
public class RabbitmqQueueAutoConfiguration {

	@Bean
	public RabbitmqQueueService rabbitmqQueueService(RabbitMQTemplate template) {
		return new RabbitmqQueueService(template);
	}
}
